package com.cqu.hhx.driver.mapper;

import com.cqu.hhx.driver.entity.Customer;
import com.cqu.hhx.driver.entity.forWeb.ChangeReq;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author DJ
 * @create 2020-05-24 21:33
 * 乘客
 */
@Mapper
public interface CustomerMapper {
    /**
     * 通过账户获取乘客信息
     * @param account
     * @return
     */
    public Customer getCustomerInfo(@Param("account") String account);

    /**
     * 通过乘客Id获取乘客信息
     * @param customerId
     * @return
     */
    public Customer getCustomerInfoById(@Param("customerId") Long customerId);

    /**
     * 更新乘客信息：姓名，手机号
     * @param customerId
     * @param name
     * @param phone
     * @return
     */
    public int updateCustomer(@Param("customerId") Long customerId,
                              @Param("name") String name,@Param("phone") String phone);

    /**
     * 重置乘客密码：123456
     * @param customerId
     * @return
     */
    public int resetPassword(@Param("customerId") Long customerId);

    /**
     * 删除乘客
     * @param customerId
     * @return
     */
    public int deleteCustomer(@Param("customerId") Long customerId);

    /**
     * 注册乘客账户
     * @param customer
     * @return
     */
    public Integer addCustomer(Customer customer);

    /**
     * 更新乘客账户余额
     * @param customerId
     * @param money
     * @return
     */
    public Integer updateCustomerMoney(@Param("customerId") Long customerId,
                                       @Param("money") Float money);


}
